import sys
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from PyQt5.QtCore import *
class Demo(QWidget):
    def __init__(self,parent=None):
        super(Demo,self).__init__(parent)
        filename='.\images\Cloudy_72px.png'
        img=QImage(filename)
        label=QLabel(self)
        label.setFixedSize(120,120)
        result=img.scaled(label.width(),label.height(),Qt.IgnoreAspectRatio,Qt.SmoothTransformation)
        label.setPixmap(QPixmap.fromImage(result))
        vbox=QVBoxLayout(self)
        vbox.addWidget(label)
        self.setWindowTitle("缩放")
if __name__ == '__main__':
    app=QApplication(sys.argv)
    win=Demo()
    win.show()
    sys.exit(app.exec_())